﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<skags.Models.ArticleTablesViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Greinar eftir flokk
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("ArticleNavigation"); %>
<% Html.RenderPartial("ArticleCategories"); %>
</div>
<div id="content">
<%
    if (Model.Article.Count() == 0)
    {
        Response.Write("Engar greinar í þessum flokk.");
    }
    else
    {
        foreach (var articleitem in Model.Article)
        {
           %>
                <div class="news_item">
                <h2><%= Html.ActionLink(articleitem.Title, "ViewItem", new { articleitem.ID })%></h2>
                <h3 class="news_date"><%= articleitem.DateCreated%></h3>
                <h3 class="news_readCount">Fjöldi lesninga: <%= articleitem.ReadCount.ToString() == "" ? 0 : articleitem.ReadCount %></h3>
                <p class="news_text"><%= articleitem.Text%></p>
            </div>
           <%
        }
    }
     %>
</div>
</asp:Content>
